package cn.tedu.cgb2110boot02.filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;
//@WebFilter("/*")//通配，所有资源
//@WebFilter("/a/*")//按照指定的前缀来匹配
//@WebFilter("/*.html")//按照指定的后缀来匹配
@WebFilter("/1.html")//必须访问指定文件
public class Filter2 implements Filter {
    public void destroy() {
    }

    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
        System.out.println("过滤器2已经生效~");
        chain.doFilter(req, resp);
    }

    public void init(FilterConfig config) throws ServletException {

    }

}
